//
//  CZQHomeAddreeTCell.m
//  coachmanage
//
//  Created by 众拳科技 on 2018/3/22.
//  Copyright © 2018年 众拳科技. All rights reserved.
//

#import "CZQHomeAddreeTCell.h"

@implementation CZQHomeAddreeTCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        
        /**
         场地图片
         */
        UIImageView *jobImageView = [UIImageView new];
        jobImageView.image = PlaceHold;
        [self addSubview:jobImageView];
        self.jobImageView = jobImageView;
        

        /**
         场地名字
         */
        UILabel *jobNameLable = [UILabel new];
        jobNameLable.text = @"华武决";
        jobNameLable.font = MidBigFont;
        jobNameLable.textColor = BlackColor;
        [self addSubview:jobNameLable];
        self.jobNameLable = jobNameLable;
        
        /**
         场地地址距离
         */
        UILabel *jobJLLable = [UILabel new];
        jobJLLable.text = @"110km";
        jobJLLable.font = MidFont;
        jobJLLable.textColor = GrakColor;
        [self addSubview:jobJLLable];
        self.jobJLLable = jobJLLable;
        
        /**
         场地地址
         */
        UILabel *jobAddressLable = [UILabel new];
        jobAddressLable.text = @"九江市艺术中心";
        jobAddressLable.font = MidFont;
        jobAddressLable.textColor = GrakColor;
        [self addSubview:jobAddressLable];
        self.jobAddressLable = jobAddressLable;

        
        
        
        /**
         场地地址
         */
        UIButton *jobAddressBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        jobAddressBtn.contentEdgeInsets = UIEdgeInsetsMake(5, 10, 5, 10);
        [jobAddressBtn setImage:@"icon_distance"];
        [self addSubview:jobAddressBtn];
        self.jobAddressBtn = jobAddressBtn;
        
        [self setConstraints];
        
        
    }
    return self;
}


-(void)setConstraints
{
    
    /**
     场地图片
     */
    [self.jobImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.top.mas_equalTo(self).offset(15);
        make.bottom.mas_equalTo(self).offset(-15);
        make.width.height.mas_equalTo(80);
        
    }];
    
    
    
    /**
     场地名字
     */
    [self.jobNameLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.jobImageView);
        make.left.mas_equalTo(self.jobImageView.mas_right).offset(10);
        
    }];
    
    
    /**
     场地地址距离
     */
    [self.jobJLLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.mas_equalTo(self.jobNameLable);
        make.left.mas_equalTo(self.jobNameLable.mas_right).offset(10);
        
    }];
    
    
    /**
     场地地址
     */
    [self.jobAddressLable mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.bottom.mas_equalTo(self.jobImageView);
        make.left.mas_equalTo(self.jobImageView.mas_right).offset(10);
        
    }];
    
    
    /**
     场地地址
     */
    
    [self.jobAddressBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.mas_equalTo(self.jobAddressLable);
        make.right.mas_equalTo(self).offset(-10);
        
    }];
    
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
